<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        div{
            width: 50px;
            height: 50px;
            background-color: black;
            color: white;
            float: left;
            text-align: center;
            margin-left: 20px;
        }
    </style>
</head>

<body>
    <div>1</div>
    <div>2</div>
    <div>3</div>
    <script>
        var div = document.querySelectorAll('div')
        //获取当前的系统时间
        var time = new Date();
        var h=time.getHours();
        var m=time.getMinutes();
        var s=time.getSeconds();
        var time1 = new Date(2020,11,16); //获取要倒计时的时间
        var time2 = time1.getTime()-time.getTime();
        // console.log(time1);
        // console.log(time2);
        // 计算剩余的时间
        var hh=parseInt(h/(60*60*1000))
        console.log(hh);
        
    </script>
</body>

</html>